<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class User extends CI_Controller {

	public function index()
	{
		$this->load->model('user_model','',true);
		
		/*测试
		$rs = $this->user_model->getuserbyuids(array(1,2,3,4,5));
		var_dump($rs);
		exit();		
		*/
		
		$data = array(
				'passwd'	=>'ttt1',
				'phone'		=>'ttt2',
				'email'		=>'ttt3',
				'address'	=>'ttt4',
				'lastinfo'	=>json_encode(array('time5'=>time(),'ip5'=>$_SERVER['REMOTE_ADDR'])),
				'extend'	=>json_encode(array('ttt7'=>time(),'tttt8'=>$_SERVER['REMOTE_ADDR']))
		);
		$data1 = array();
		for ($i = 0; $i < 5; $i++){
			$data1[] = $data;
		}
		$rs = $this->user_model->insert_batch($data1);
		var_dump($rs);
		exit();
		/*
		$rs = $this->user_model->checkpass('ttt1','','123');
		var_dump($rs);
		exit();
		*/
		$data = array(
				'passwd'	=>'ttt1',
				'phone'		=>'ttt2',
				'email'		=>'ttt3',
				'address'	=>'ttt4',
				'lastinfo'	=>json_encode(array('time5'=>time(),'ip5'=>$_SERVER['REMOTE_ADDR'])),
				'extend'	=>json_encode(array('ttt7'=>time(),'tttt8'=>$_SERVER['REMOTE_ADDR']))
				);
		$data['uid'] = 3;
		$data = $this->user_model->update($data);
		var_dump($data);
		exit();
		$uid = $this->user_model->insert($data);
		echo $uid;
	
		$uid=2;
		
		if ($uid === false){
			die('inset fail');
		}
	    
	    $data = $this->user_model->get($uid);
	    var_dump($data);
		$this->load->view('welcome_message');
	}
}
